<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AUnit: /home/brian/src/AUnit/src/aunit/Flash.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AUnit
   &#160;<span id="projectnumber">1.7.1</span>
   </div>
   <div id="projectbrief">Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_81cd3825682eb05918933587e078c005.html">aunit</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a>  </div>
  <div class="headertitle">
<div class="title">Flash.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Various macros to smooth over the differences among the various platforms with regards to their support for flash strings and the various macros used to create and access them.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;avr/pgmspace.h&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for Flash.h:</div>
<div class="dyncontent">
<div class="center"><img src="Flash_8h__incl.png" border="0" usemap="#a_2home_2brian_2src_2AUnit_2src_2aunit_2Flash_8h" alt=""/></div>
<map name="a_2home_2brian_2src_2AUnit_2src_2aunit_2Flash_8h" id="a_2home_2brian_2src_2AUnit_2src_2aunit_2Flash_8h">
<area shape="rect" title="Various macros to smooth over the differences among the various platforms with regards to their suppo..." alt="" coords="5,5,168,47"/>
<area shape="rect" title=" " alt="" coords="23,95,150,121"/>
</map>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="Flash_8h__dep__incl.png" border="0" usemap="#a_2home_2brian_2src_2AUnit_2src_2aunit_2Flash_8hdep" alt=""/></div>
<map name="a_2home_2brian_2src_2AUnit_2src_2aunit_2Flash_8hdep" id="a_2home_2brian_2src_2AUnit_2src_2aunit_2Flash_8hdep">
<area shape="rect" title="Various macros to smooth over the differences among the various platforms with regards to their suppo..." alt="" coords="667,5,830,47"/>
<area shape="rect" href="Assertion_8cpp_source.html" title=" " alt="" coords="147,184,321,225"/>
<area shape="rect" href="Assertion_8h_source.html" title=" " alt="" coords="461,95,623,136"/>
<area shape="rect" href="MetaAssertion_8cpp_source.html" title=" " alt="" coords="5,273,212,315"/>
<area shape="rect" href="TestMacros_8h.html" title="Various macros (test(), testF(), testing(), testingF(), externTest(), externTestF(),..." alt="" coords="637,363,807,404"/>
<area shape="rect" href="Compare_8cpp_source.html" title=" " alt="" coords="1024,95,1196,136"/>
<area shape="rect" href="MetaAssertMacros_8h.html" title="Various assertTestXxx(), checkTestXxx(), assertTestXxxF() and checkTestXxxF() macros are defined in t..." alt="" coords="1183,363,1402,404"/>
<area shape="rect" href="Printer_8cpp_source.html" title=" " alt="" coords="1221,95,1383,136"/>
<area shape="rect" href="Test_8cpp_source.html" title=" " alt="" coords="1407,95,1570,136"/>
<area shape="rect" href="MetaAssertion_8h_source.html" title=" " alt="" coords="446,184,638,225"/>
<area shape="rect" href="AUnit_8h.html" title="Same as AUnitVerbose.h except that the terse versions of the various assertXxx() macros are provided." alt="" coords="1039,452,1202,493"/>
<area shape="rect" href="AUnitVerbose_8h.html" title="Same as AUnit.h except that the verbose versions of the various assertXxx() macros are provided." alt="" coords="455,452,618,493"/>
<area shape="rect" href="TestAgain_8h_source.html" title=" " alt="" coords="763,273,926,315"/>
<area shape="rect" href="TestOnce_8h_source.html" title=" " alt="" coords="461,273,623,315"/>
<area shape="rect" href="TestAgain_8cpp_source.html" title=" " alt="" coords="882,363,1058,404"/>
<area shape="rect" href="TestOnce_8cpp_source.html" title=" " alt="" coords="389,363,561,404"/>
</map>
</div>
</div>
<p><a href="Flash_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a29588725953276554c1abde9d718ef7f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="Flash_8h.html#a29588725953276554c1abde9d718ef7f">AUNIT_FPSTR</a>(pstr)&#160;&#160;&#160;reinterpret_cast&lt;const __FlashStringHelper *&gt;(pstr)</td></tr>
<tr class="memdesc:a29588725953276554c1abde9d718ef7f"><td class="mdescLeft">&#160;</td><td class="mdescRight">The FPSTR() macro is defined on ESP8266 and ESP32, but not on other platforms (e.g.  <a href="Flash_8h.html#a29588725953276554c1abde9d718ef7f">More...</a><br /></td></tr>
<tr class="separator:a29588725953276554c1abde9d718ef7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad617776253d49a26ec166e89d3ccdb13"><td class="memItemLeft" align="right" valign="top"><a id="ad617776253d49a26ec166e89d3ccdb13"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>AUNIT_F</b>(x)&#160;&#160;&#160;F(x)</td></tr>
<tr class="separator:ad617776253d49a26ec166e89d3ccdb13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8af1cc92935269a48d678adbc21459a"><td class="memItemLeft" align="right" valign="top"><a id="aa8af1cc92935269a48d678adbc21459a"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>SERIAL_PORT_MONITOR</b>&#160;&#160;&#160;Serial</td></tr>
<tr class="separator:aa8af1cc92935269a48d678adbc21459a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Various macros to smooth over the differences among the various platforms with regards to their support for flash strings and the various macros used to create and access them. </p>
<p>On AVR, flash strings are fully supported through the F() and PSTR() macros, and the (const __FlashStringHelper*) pointer. However, the useful FPSTR() macro is not defined.</p>
<p>Seeeduino SAMD core has a broken implementation of FPSTR(). This file clobbers that implementation.</p>
<p>Adafruit's SAMD core fixes the broken FPSTR(), so we don't have to do anything.</p>
<p>Arduino's SAMD core breaks backwards compatibility after version &gt;= 1.8.10. AUnit does not support the ArduinoCore-API, so Arduino-branded SAMD boards are explicitly blacklisted.</p>
<p>STM32duino seems to have forked from Teensyduino, so it too has F() and PSTR(), but no FPSTR() macro.</p>
<p>The ESP8266 platform used to have flash strings which were buggy and brittle, and often failed with obscure errors messages, see for example, <a href="https://github.com/esp8266/Arduino/issues/3369">https://github.com/esp8266/Arduino/issues/3369</a>. This bug was fixed in Dec 2018, so the ESP8266 is fully supported.</p>
<p>The ESP32 had a broken implementation of FPSTR() (<a href="https://github.com/espressif/arduino-esp32/issues/1371">https://github.com/espressif/arduino-esp32/issues/1371</a>), but the bug was fixed in ESP32 Core 1.0.3 around Sept 2019. ESP32 is fully supported.</p>
<p>On Teensy-ARM, flash strings are <em>not</em> supported, but F(), PSTR() and (const __FlashStringHelper*) are defined. The useful FPSTR() macro is not defined.</p>
<p>The megaAVR had a broken implementation of the F() macro (does not return a const __FlashStringHelper*), but returns a (const char*)). But more importantly, megaAVR uses the ArrduinoCore-api which is blacklisted by AUnit, so the megaAVR (e.g. Nano Every) is not supported. </p>

<p class="definition">Definition in file <a class="el" href="Flash_8h_source.html">Flash.h</a>.</p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a29588725953276554c1abde9d718ef7f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a29588725953276554c1abde9d718ef7f">&#9670;&nbsp;</a></span>AUNIT_FPSTR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define AUNIT_FPSTR</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">pstr</td><td>)</td>
          <td>&#160;&#160;&#160;reinterpret_cast&lt;const __FlashStringHelper *&gt;(pstr)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The FPSTR() macro is defined on ESP8266 and ESP32, but not on other platforms (e.g. </p>
<p>AVR, SAMD, Teensyduino, and STM32duino). We define our own version to make this work on the various platforms. </p>

<p class="definition">Definition at line <a class="el" href="Flash_8h_source.html#l00077">77</a> of file <a class="el" href="Flash_8h_source.html">Flash.h</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
